package com.jinzhi.jzweb.service.impl;

import com.baomidou.mybatisplus.plugins.Page;
import com.jinzhi.common.base.CoreServiceImpl;
import com.jinzhi.jzapi.certificate.pojo.MyOrgRolesVo;
import com.jinzhi.jzapi.certificate.pojo.OrgRolesListVo;
import com.jinzhi.jzweb.dao.OrganizationRolesDao;
import com.jinzhi.jzweb.domain.OrganizationRolesDO;
import com.jinzhi.jzweb.service.OrganizationRolesService;
import org.springframework.stereotype.Service;

import java.util.List;
import java.util.Map;

/**
 * 
 * <pre>
 * 机构角色表
 * </pre>
 * <small> 2020-02-24 21:00:11 | lance</small>
 */
@Service
public class OrganizationRolesServiceImpl extends CoreServiceImpl<OrganizationRolesDao, OrganizationRolesDO> implements OrganizationRolesService {

    @Override
    public Page<OrgRolesListVo> selectListPage(int current, int number, Map map) {

        // 新建分页
        Page<OrgRolesListVo> page = new Page<OrgRolesListVo>(current, number);
        return page.setRecords(this.baseMapper.dyGetUserList(page,map));
    }

    @Override
    public Page<MyOrgRolesVo> selByUserId(int current, int number, Long userId) {

        // 新建分页
        Page<MyOrgRolesVo> page = new Page<MyOrgRolesVo>(current, number);

        return page.setRecords(this.baseMapper.selByUserId(page,userId));

    }

    @Override
    public Long selById(Map map){
        return baseMapper.selById(map);
    }

    @Override
    public List<Map<Object,Object>> selByRoleType(Integer roleType){
        return baseMapper.selByRoleType(roleType);
    }

    @Override
    public int selNoReviewAll(){
        return this.baseMapper.selNoReviewAll();
    }

    @Override
    public List<Map> selByRoleProvince(Map map){
        return this.baseMapper.selByRoleProvince(map);
    }

    @Override
    public String selByIdProName(Map map){
        return this.baseMapper.selByIdProName(map);
    }
}
